<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>自定义提示内容 - jQuery EasyUI 演示</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
	<h2 title="Custom Tooltip Content">自定义提示内容</h2>
	<p title="Access to each elements attribute to get the tooltip content.">　　对每个元素属性的访问可获取提示框的内容。注：因提示框加于按钮上，所以本例不宜用于移动设备。</p>
	<div style="margin:20px 0;"></div>
	<div class="easyui-panel">
		<div id="pg" data-options="total:114"></div>
	</div>
	
	<script>
		$(function(){
			$('#pg').pagination().find('a.l-btn').tooltip({
				content: function(){
					var cc = $(this).find('span.l-btn-icon').attr('class').split(' ');
					var icon = cc[1].split('-')[1];
					//console.info(icon);
					return ptCN(icon)+'页';
				}
			});
		});
		function ptCN(_i){
			var _r='';
			switch(_i){
				case 'first': _r='第一'; break;
				case 'prev': _r='上一'; break;
				case 'next': _r='下一'; break;
				case 'last': _r='最后一'; break;
				case 'load': _r='重载该'; break;
				default: _r='';
			}
			return _r;
		}
	</script>
</body>
</html>